|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfurny.furndb.PNGLoader
public class PNGLoader
AssetLoader implementation to load PNG files.
| Field Summary | |
|---|---|
static java.awt.image.ColorModel |
AWT_RGBA4444
|
static java.awt.image.ColorModel |
AWT_RGBA5551
|
| Constructor Summary | |
|---|---|
PNGLoader()
|
|
| Method Summary | |
|---|---|
private byte[] |
extractImageData(java.awt.image.BufferedImage img)
Gets a byte array from an image. |
private void |
flipImage(byte[] img,
int width,
int height,
int bpp)
Flips an image in the byte buffer. |
java.lang.Object |
load(com.jme3.asset.AssetInfo info)
|
com.jme3.texture.Image |
load(java.awt.image.BufferedImage img,
boolean flipY)
Converts an buffered image to a JME image. |
com.jme3.texture.Image |
load(java.lang.String key,
boolean flipY)
Loads an image from the furniture db. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.awt.image.ColorModel AWT_RGBA4444
public static final java.awt.image.ColorModel AWT_RGBA5551
| Constructor Detail |
|---|
public PNGLoader()
| Method Detail |
|---|
private byte[] extractImageData(java.awt.image.BufferedImage img)
img - The image
private void flipImage(byte[] img,
int width,
int height,
int bpp)
img - The imagewidth - The width of the imageheight - The height of the imagebpp - The color depth (bits per pixel)
public com.jme3.texture.Image load(java.awt.image.BufferedImage img,
boolean flipY)
img - The image to convertflipY - Flips the image if true
public com.jme3.texture.Image load(java.lang.String key,
boolean flipY)
throws java.io.IOException
key - The key of the imageflipY - Flips the image if true
java.io.IOException - if byte/image conversion fails
public java.lang.Object load(com.jme3.asset.AssetInfo info)
throws java.io.IOException
load in interface com.jme3.asset.AssetLoaderjava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||